// Learn cc.Class:
//  - https://docs.cocos.com/creator/manual/en/scripting/class.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html

cc.Class({
    extends: cc.Component,

    properties: {
        //音乐开关
        toggleMusic:cc.Toggle,
        //音效开关
        toggleSound:cc.Toggle,

    },

  
    onLoad () {
        this.toggleMusic.isChecked=window.gameConfig.gameData.isMusic;
        this.toggleSound.isChecked=window.gameConfig.gameData.isSound;
    },

    onClickMusic(){
        window.gameConfig.gameData.isMusic= this.toggleMusic.isChecked;
    },

    onClickMusic(){
        window.gameConfig.gameData.isMusic= this.toggleSound.isChecked;
    },

    closeLayer(event){
        event.interactable = false;
        window.closePop(this.node);
    }
    // update (dt) {},
});
